﻿namespace ufida.u9.ait.openapi
{
	using System;
	using System.Collections.Generic;
	using ufida.u9.ait.openapi.utils;
	using UFIDA.U9.CBO.Pub.Controller;
	using UFIDA.U9.PR.PurchaseRequest;
	using UFSoft.UBF.AopFrame;
	using UFSoft.UBF.Business;
    using UFSoft.UBF.Transactions;

    /// <summary>
    /// PRSaveSV partial 
    /// </summary>	
    public partial class PRSaveSV 
	{	
		internal BaseStrategy Select()
		{
			return new PRSaveSVImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class PRSaveSVImpementStrategy : BaseStrategy
	{
		public PRSaveSVImpementStrategy() { }

		public override object Do(object obj)
		{						
			PRSaveSV bpObj = (PRSaveSV)obj;
			
			return CodeUtils.DocSaveRT(bpObj,bpObj.Data,PRBase.CreatePR,
				doc =>
				{
					PRBase.CommitDoc(doc);
					PRBase.ApproveDoc(doc);
					return doc;
				});
		}
    }

	#endregion
	
	
}